Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vanilla-extract/sprinkles

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vanilla-extract/sprinkles

Zero-runtime atomic CSS framework for vanilla-extract

  • 1.6.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created

What is @vanilla-extract/sprinkles?

@vanilla-extract/sprinkles is a utility for creating type-safe, theme-aware utility styles in Vanilla Extract. It allows you to define design tokens and responsive styles in a type-safe manner, making it easier to manage and apply consistent styling across your application.

What are @vanilla-extract/sprinkles's main functionalities?

Define Design Tokens

You can define design tokens such as colors and spacing scales, which can be used throughout your application to ensure consistency.

const colors = {
  primary: 'blue',
  secondary: 'green'
};

const space = {
  small: '4px',
  medium: '8px',
  large: '16px'
};

Create Sprinkles

Sprinkles allow you to create utility classes based on your design tokens. This makes it easy to apply consistent styles across your application.

import { createSprinkles, defineProperties } from '@vanilla-extract/sprinkles';

const sprinkles = createSprinkles(
  defineProperties({
    properties: {
      color: ['primary', 'secondary'],
      padding: ['small', 'medium', 'large']
    }
  })
);

Apply Sprinkles

You can apply the sprinkles to your components, ensuring that the styles are type-safe and consistent with your design tokens.

import { sprinkles } from './sprinkles.css';

const className = sprinkles({
  color: 'primary',
  padding: 'medium'
});

Other packages similar to @vanilla-extract/sprinkles

FAQs

Package last updated on 18 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc